Solid State Drives (SSDs) are rapidly replacing traditional hard disk drives in data centers. The cost per gigabyte of SSDs is slowly declining, and SSDs deliver an order of magnitude better latency and performance.
An SSD is a flash memory based data storage device. Data is stored in individual cells, which are organized into groups called a page. Pages in turn are organized into groups called blocks. The page is the smallest unit that may be read or written: reads and writes are aligned at the page size. Even if the request involves a smaller amount of data than a page, an entire page is read or written.
In SSDs, overwrites are not permitted. When existing data is changed, the page storing the data being changed is copied into an internal register within the SSD, updated, and then written to a free page. The old page is then marked as stale or invalid, indicating that the data stored thereon is no longer valid. Stale data may not be overwritten, and must be reclaimed (via erasure) to be marked as free. This recovery operation is called garbage collection.
But while read and write requests operate on pages, pages may not be erased individually. The erase unit size is usually a block.
A block might contain some valid pages and some invalid/stale pages. In that situation, before the block may be erased, the valid data must be copied to a free page in another block (called a Program operation). Then, after any valid data has been copied out of the block, the block may be erased. Garbage collection includes both this Program operation and the erase operation: this combination of operations is called the Program/Erase (P/E) cycle.
If write requests arrive during garbage collection, they are stalled until garbage collection completes. In this situation, the write request incurs an additional latency equal to the sum of the latency required for the P/E cycle (beyond the latency required for the write operation itself). For critical writes, this additional latency may prove to be very costly. In addition, in heavy write workloads, garbage collection will occur frequently, thus increasing the interference with read and write requests.
A need remains for a way to reduce the potential latency experienced by write requests due to the P/E cycle in SSDs in a distributed storage system.